Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Block Truncation Coding</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Block_Truncation_Coding"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Block_Truncation_Coding rootpage-Block_Truncation_Coding skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Block Truncation Coding</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p><b>Block Truncation Coding</b> (<b>BTC</b>) is a type of <a href="Lossy_compression" title="Lossy compression">lossy image compression</a> technique for <a href="Greyscale" class="mw-redirect" title="Greyscale">greyscale</a> images. It divides the original images into blocks and then uses a quantizer to reduce the number of <a href="Grey_levels" class="mw-redirect" title="Grey levels">grey levels</a> in each block whilst maintaining the same <a href="Mean" title="Mean">mean</a> and <a href="Standard_deviation" title="Standard deviation">standard deviation</a>. It is an early predecessor of the popular hardware <a href="S3_Texture_Compression" title="S3 Texture Compression">DXTC</a> technique, although BTC compression method was first adapted to color long before DXTC using a very similar approach called <a href="Color_Cell_Compression" title="Color Cell Compression">Color Cell Compression</a>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> BTC has also been adapted to video compression.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p><p>BTC was first proposed by Professors Mitchell and Delp at Purdue University.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> Another variation of BTC is <b>Absolute Moment Block Truncation Coding</b> or <b>AMBTC</b>, in which instead of using the standard deviation the first absolute moment is preserved along with the mean. AMBTC is computationally simpler than BTC and also typically results in a lower Mean Squared Error (MSE). AMBTC was proposed by Maximo Lema and Robert Mitchell.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p><p>Using sub-blocks of 4×4 pixels gives a compression ratio of 4:1 assuming 8-bit integer values are used during transmission or storage. Larger blocks allow greater compression ("a" and "b" values spread over more pixels) however quality also reduces with the increase in block size due to the nature of the algorithm.
</p><p>The BTC algorithm was used for compressing <a href="Mars_Pathfinder" title="Mars Pathfinder">Mars Pathfinder</a>'s rover images.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Compression_procedure">Compression procedure</h2></div>
<p>A <a href="Pixel" title="Pixel">pixel</a> image is divided into blocks of typically 4×4 pixels. For each block the <a href="Arithmetic_mean" title="Arithmetic mean">Mean</a> and <a href="Standard_deviation" title="Standard deviation">Standard Deviation</a> of the pixel values are calculated; these statistics generally change from block to block. The pixel values selected for each reconstructed, or new, block are chosen so that each block of the BTC compressed image will have (approximately) the same mean and standard deviation as the corresponding block of the original image. A two level quantization on the block is where we gain the compression and is performed as follows:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle y(i,j)={\begin{cases}1,&amp;x(i,j)>{\bar {x}}\\0,&amp;x(i,j)\leq {\bar {x}}\end{cases}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>y</mi>
<mo stretchy="false">(</mo>
<mi>i</mi>
<mo>,</mo>
<mi>j</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow>
<mo>{</mo>
<mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false">
<mtr>
<mtd>
<mn>1</mn>
<mo>,</mo>
</mtd>
<mtd>
<mi>x</mi>
<mo stretchy="false">(</mo>
<mi>i</mi>
<mo>,</mo>
<mi>j</mi>
<mo stretchy="false">)</mo>
<mo>&gt;</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>x</mi>
<mo stretchy="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
<mo>,</mo>
</mtd>
<mtd>
<mi>x</mi>
<mo stretchy="false">(</mo>
<mi>i</mi>
<mo>,</mo>
<mi>j</mi>
<mo stretchy="false">)</mo>
<mo>≤<!-- ≤ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>x</mi>
<mo stretchy="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
</mrow>
</mtd>
</mtr>
</mtable>
<mo fence="true" stretchy="true" symmetric="true"></mo>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle y(i,j)={\begin{cases}1,&amp;x(i,j)&gt;{\bar {x}}\\0,&amp;x(i,j)\leq {\bar {x}}\end{cases}}}</annotation>
</semantics>
</math></span><img src="./05aab8efbc83a69b1fe6649e5d5a3690401bd7d8.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:25.846ex; height:6.176ex;" alt="{\displaystyle y(i,j)={\begin{cases}1,&amp;x(i,j)>{\bar {x}}\\0,&amp;x(i,j)\leq {\bar {x}}\end{cases}}}" loading="lazy"></span>
</p><p>Here <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x(i,j)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>x</mi>
<mo stretchy="false">(</mo>
<mi>i</mi>
<mo>,</mo>
<mi>j</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle x(i,j)}</annotation>
</semantics>
</math></span><img src="./fa564861b679d04c45d07bfcae975b0bbc17b576.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.933ex; height:2.843ex;" alt="{\displaystyle x(i,j)}" loading="lazy"></span> are pixel elements of the original block and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle y(i,j)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>y</mi>
<mo stretchy="false">(</mo>
<mi>i</mi>
<mo>,</mo>
<mi>j</mi>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle y(i,j)}</annotation>
</semantics>
</math></span><img src="./31b7111654b899d4d9ecc51749fb0ef416a9348c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.759ex; height:2.843ex;" alt="{\displaystyle y(i,j)}" loading="lazy"></span> are elements of the compressed block. In words this can be explained as: If a pixel value is greater than the mean it is assigned the value "1", otherwise "0". Values equal to the mean can have either a "1" or a "0" depending on the preference of the person or organisation implementing the algorithm.
</p><p>This 16-bit block is stored or transmitted along with the values of Mean and Standard Deviation. Reconstruction is made with two values "a" and "b" which preserve the mean and the standard deviation. The values of "a" and "b" can be computed as follows:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a={\bar {x}}-\sigma {\sqrt {\cfrac {q}{m-q}}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>a</mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>x</mi>
<mo stretchy="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
</mrow>
<mo>−<!-- − --></mo>
<mi>σ<!-- σ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mfrac>
<mrow>
<mpadded width="0" height="8.6pt" depth="3pt">
<mrow></mrow>
</mpadded>
<mstyle displaystyle="false" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi>q</mi>
</mrow>
</mstyle>
</mrow>
<mrow>
<mpadded width="0" height="8.6pt" depth="3pt">
<mrow></mrow>
</mpadded>
<mstyle displaystyle="false" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
<mo>−<!-- − --></mo>
<mi>q</mi>
</mrow>
</mstyle>
</mrow>
</mfrac>
</msqrt>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a={\bar {x}}-\sigma {\sqrt {\cfrac {q}{m-q}}}}</annotation>
</semantics>
</math></span><img src="./4866158525818962183b3b420000e62d88547032.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:19.068ex; height:7.843ex;" alt="{\displaystyle a={\bar {x}}-\sigma {\sqrt {\cfrac {q}{m-q}}}}" loading="lazy"></span>
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle b={\bar {x}}+\sigma {\sqrt {\cfrac {m-q}{q}}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>b</mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>x</mi>
<mo stretchy="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
</mrow>
<mo>+</mo>
<mi>σ<!-- σ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mfrac>
<mrow>
<mpadded width="0" height="8.6pt" depth="3pt">
<mrow></mrow>
</mpadded>
<mstyle displaystyle="false" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi>m</mi>
<mo>−<!-- − --></mo>
<mi>q</mi>
</mrow>
</mstyle>
</mrow>
<mrow>
<mpadded width="0" height="8.6pt" depth="3pt">
<mrow></mrow>
</mpadded>
<mstyle displaystyle="false" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi>q</mi>
</mrow>
</mstyle>
</mrow>
</mfrac>
</msqrt>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle b={\bar {x}}+\sigma {\sqrt {\cfrac {m-q}{q}}}}</annotation>
</semantics>
</math></span><img src="./33449beea4e124b5ea21147fb2d98f2dea7bbd6b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:18.836ex; height:7.843ex;" alt="{\displaystyle b={\bar {x}}+\sigma {\sqrt {\cfrac {m-q}{q}}}}" loading="lazy"></span>
</p><p>Where <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \sigma }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>σ<!-- σ --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \sigma }</annotation>
</semantics>
</math></span><img src="./59f59b7c3e6fdb1d0365a494b81fb9a696138c36.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.33ex; height:1.676ex;" alt="{\displaystyle \sigma }" loading="lazy"></span> is the standard deviation, m is the total number of pixels in the block and q is the number of pixels greater than the mean (<span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\bar {x}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mi>x</mi>
<mo stretchy="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\bar {x}}}</annotation>
</semantics>
</math></span><img src="./466e03e1c9533b4dab1b9949dad393883f385d80.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.33ex; height:2.009ex;" alt="{\displaystyle {\bar {x}}}" loading="lazy"></span>)
</p><p>To reconstruct the image, or create its approximation, elements assigned a 0 are replaced with the "a" value and elements assigned a 1 are replaced with the "b" value.
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x(i,j)={\begin{cases}a,&amp;y(i,j)=0\\b,&amp;y(i,j)=1\end{cases}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>x</mi>
<mo stretchy="false">(</mo>
<mi>i</mi>
<mo>,</mo>
<mi>j</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow>
<mo>{</mo>
<mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false">
<mtr>
<mtd>
<mi>a</mi>
<mo>,</mo>
</mtd>
<mtd>
<mi>y</mi>
<mo stretchy="false">(</mo>
<mi>i</mi>
<mo>,</mo>
<mi>j</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>b</mi>
<mo>,</mo>
</mtd>
<mtd>
<mi>y</mi>
<mo stretchy="false">(</mo>
<mi>i</mi>
<mo>,</mo>
<mi>j</mi>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mn>1</mn>
</mtd>
</mtr>
</mtable>
<mo fence="true" stretchy="true" symmetric="true"></mo>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle x(i,j)={\begin{cases}a,&amp;y(i,j)=0\\b,&amp;y(i,j)=1\end{cases}}}</annotation>
</semantics>
</math></span><img src="./03aa00635a3cd0bc5905f12dd8e8848aa514b224.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:25.746ex; height:6.176ex;" alt="{\displaystyle x(i,j)={\begin{cases}a,&amp;y(i,j)=0\\b,&amp;y(i,j)=1\end{cases}}}" loading="lazy"></span>
</p><p>This demonstrates that the algorithm is asymmetric in that the encoder has much more work to do than the decoder. This is because the decoder is simply replacing 1's and 0's with the estimated value whereas the encoder is also required to calculate the mean, standard deviation and the two values to use.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Example">Example</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Encoder">Encoder</h3></div>
<p>Take a 4×4 block from an image, in this case the mountain test image:<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{matrix}245&amp;239&amp;249&amp;239\\245&amp;245&amp;239&amp;235\\245&amp;245&amp;245&amp;245\\245&amp;235&amp;235&amp;239\end{matrix}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable rowspacing="4pt" columnspacing="1em">
<mtr>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>239</mn>
</mtd>
<mtd>
<mn>249</mn>
</mtd>
<mtd>
<mn>239</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>239</mn>
</mtd>
<mtd>
<mn>235</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>245</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>235</mn>
</mtd>
<mtd>
<mn>235</mn>
</mtd>
<mtd>
<mn>239</mn>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{matrix}245&amp;239&amp;249&amp;239\\245&amp;245&amp;239&amp;235\\245&amp;245&amp;245&amp;245\\245&amp;235&amp;235&amp;239\end{matrix}}}</annotation>
</semantics>
</math></span><img src="./5bdd382de82a371edb7b3ec020c170c92613ddcd.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -5.671ex; width:21.669ex; height:12.509ex;" alt="{\displaystyle {\begin{matrix}245&amp;239&amp;249&amp;239\\245&amp;245&amp;239&amp;235\\245&amp;245&amp;245&amp;245\\245&amp;235&amp;235&amp;239\end{matrix}}}" loading="lazy"></span>
</p><p>Like any small block from an image this appears rather boring to work with as the numbers are all quite similar, this is the nature of lossy compression and how it can work so well for images. Now we need to calculate two values from this data, that is the mean and standard deviation. The mean can be computed to 241.875, this is a simple calculation which should require no further explanation. The standard deviation is easily calculated at 4.36. From this the values of "a" and "b" can be calculated using the previous equations. They come out to be 236.935 and 245.718 respectively. The last calculation that needs to be done on the encoding side is to set the matrix to transmit to 1's and 0's so that each pixel can be transmitted as a single bit.
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{matrix}1&amp;0&amp;1&amp;0\\1&amp;1&amp;0&amp;0\\1&amp;1&amp;1&amp;1\\1&amp;0&amp;0&amp;0\end{matrix}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable rowspacing="4pt" columnspacing="1em">
<mtr>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>1</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{matrix}1&amp;0&amp;1&amp;0\\1&amp;1&amp;0&amp;0\\1&amp;1&amp;1&amp;1\\1&amp;0&amp;0&amp;0\end{matrix}}}</annotation>
</semantics>
</math></span><img src="./1f297e4c0670a3ab43cf29412d5610167d57a7d0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -5.671ex; width:12.369ex; height:12.509ex;" alt="{\displaystyle {\begin{matrix}1&amp;0&amp;1&amp;0\\1&amp;1&amp;0&amp;0\\1&amp;1&amp;1&amp;1\\1&amp;0&amp;0&amp;0\end{matrix}}}" loading="lazy"></span>
</p>
<div class="mw-heading mw-heading3"><h3 id="Decoder">Decoder</h3></div>
<p>Now at the decoder side all we need to do is reassign the "a" and "b" values to the 1 and 0 pixels. This will give us the following block:
</p><p><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{matrix}245&amp;236&amp;245&amp;236\\245&amp;245&amp;236&amp;236\\245&amp;245&amp;245&amp;245\\245&amp;236&amp;236&amp;236\end{matrix}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable rowspacing="4pt" columnspacing="1em">
<mtr>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>236</mn>
</mtd>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>236</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>236</mn>
</mtd>
<mtd>
<mn>236</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>245</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>245</mn>
</mtd>
<mtd>
<mn>236</mn>
</mtd>
<mtd>
<mn>236</mn>
</mtd>
<mtd>
<mn>236</mn>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{matrix}245&amp;236&amp;245&amp;236\\245&amp;245&amp;236&amp;236\\245&amp;245&amp;245&amp;245\\245&amp;236&amp;236&amp;236\end{matrix}}}</annotation>
</semantics>
</math></span><img src="./35cbbde405c052ad66fd285e861a4933b8095167.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -5.671ex; width:21.669ex; height:12.509ex;" alt="{\displaystyle {\begin{matrix}245&amp;236&amp;245&amp;236\\245&amp;245&amp;236&amp;236\\245&amp;245&amp;245&amp;245\\245&amp;236&amp;236&amp;236\end{matrix}}}" loading="lazy"></span>
</p><p>As can be seen, the block has been reconstructed with the two values of "a" and "b" as integers (because images aren't defined to store floating point numbers). When working through the theory, this is a good point to calculate the mean and standard deviation of the reconstructed block. They should equal the original mean and standard deviation. Remember to use integers, otherwise much quantization error will become involved, as we previously quantized everything to integers in the encoder.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Color_Cell_Compression" title="Color Cell Compression">Color Cell Compression</a> ( a newer derivative of Block Truncation Coding )</li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFLiouHuangReynolds1990" class="citation book cs1">Liou, D. -M.; Huang, Y.; Reynolds, N. (1990). "A new microcomputer based imaging system with C/sup 3/ technique". <i>IEEE TENCON'90: 1990 IEEE Region 10 Conference on Computer and Communication Systems. Conference Proceedings</i>. p.&nbsp;555. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FTENCON.1990.152671">10.1109/TENCON.1990.152671</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-87942-556-3</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:62015990">62015990</a>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFHealyMitchell1981" class="citation journal cs1">Healy, D.; Mitchell, O. (1981). "Digital Video Bandwidth Compression Using Block Truncation Coding". <i>IEEE Transactions on Communications</i>. <b>29</b> (12): 1809. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/1981ITCom..29.1809H">1981ITCom..29.1809H</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FTCOM.1981.1094938">10.1109/TCOM.1981.1094938</a>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFDelpMitchell1979" class="citation journal cs1">Delp, E.; Mitchell, O. (1979). "Image Compression Using Block Truncation Coding". <i>IEEE Transactions on Communications</i>. <b>27</b> (9): 1335. <a href="Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/1979STIA...8011525D">1979STIA...8011525D</a>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FTCOM.1979.1094560">10.1109/TCOM.1979.1094560</a>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFLemaMitchell1984" class="citation journal cs1">Lema, M.; Mitchell, O. (1984). "Absolute Moment Block Truncation Coding and akhand Its Application to Color Images". <i>IEEE Transactions on Communications</i>. <b>32</b> (10): 1148. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FTCOM.1984.1095973">10.1109/TCOM.1984.1095973</a>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://pds-imaging.jpl.nasa.gov/data/mpfr-m-rvrcam-2-edr-v1.0/mprv_0001/document/rcinst.htm">"Rover Camera Instrument Description"</a>. NASA<span class="reference-accessdate">. Retrieved <span class="nowrap">2021-05-18</span></span>.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text">Leis, J 2008, ELE4607 Advance Digital Communications, Module 3: Image &amp; Video Coding. Lecture Slides, University of Southern Queensland, 2008.</span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.math.uwaterloo.ca/WatFract/Repository.html">Waterloo Fractal Coding and Analysis Group</a></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><span class="noviewer" typeof="mw:File"></span> Media related to <a href="https://commons.wikimedia.org/wiki/Category:Block_Truncation_Coding" class="extiw external" title="commons:Category:Block Truncation Coding">Block Truncation Coding</a> at Wikimedia Commons</li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2023-07-23" href="https://en.wikipedia.org/wiki/?title=Block_Truncation_Coding&amp;oldid=1166813861">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>